Return to doc.sitecore.com

Adding/removing items available for selecting within the TreeList field
Prev Next

Author: Ruslan Zhovtonoga
Posted: 9/11/2009 2:15:46 PM

Let’s assume that we have the following list of the menu items available for selecting:

 /upload/sdn5/scrapbook/scrap01.png

What should we do if the user should be able to select only subitems of the “available metals“ and “years” items?
(especially in case the “aluminium” and “2011” items should be hidden)

The source parameter of a TreeLlist field “understands” the following list of additional parameters:

Those parameters can help to organize a TreeList data especially for the current needs.

The following TreeList field source value produces the needed result:

DataSource=/sitecore/content/Home/MyMenues&IncludeItemsForDisplay=menu1,available metals,gold,silver,menu2,years,2009,2010

/upload/sdn5/scrapbook/scrap02.png

You can use similar approach especially for your purposes i.e. add additional or remove existing items for the TreeList data using the IncludeItemsForDisplay and ExcludeItemsForDisplay parameters.

Please notice that items within the source string should be comma separated and can be defined by their names or GUIDs.

Example:

DataSource=/sitecore/content/Home/MyMenues&ExcludeItemsForDisplay=2009,silver,{5D4C7425-E6E7-4243-9C1C-1C0F6C4EF78C},{09CC07AC-9D37-42B1-A6B0-C6A71A3AF2E0}

Prev Next